<template>
    <div class="ranklist-detail">
        <div class="player">
            <img :src="rankInfo.picUrl" alt="">
            <span>{{rankInfo.title}}</span>
            <span>{{rankInfo.titleDetail}}</span>
            <span>更新时间:{{updataTime}}</span>
        </div>
        <div class="ranklist">
            <ul>
                <li v-for="(item,id) in rankList" :key="item.id">
                    <span>{{id+1}}.{{item.name}}</span>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            rankList:[],//榜单详情列表
            rankInfo:{},//榜单基本信息
            updataTime:""//榜单更新时间
        }
    },
    created(){
        this.getData();
    },
    methods:{
        getData(){
            axios.get("/jsososo/top",{
                params:{
                    id: this.$route.params.id
                }
            })
            .then(res=>{
                console.log(res.data)
                this.rankList = res.data.data.list//榜单详情列表
                this.rankInfo = res.data.data.info//榜单基本信息
                this.updataTime = res.data.data.update
            }).catch(error=>{
                console.log(error)
            })
        }
    }
}
</script>
<style scoped>
.player img{
    width: 50%;border-radius: 1rem;
}
.player span{
    display: block;
}
.ranklist li{
    text-align: left;
}
.ranklist span{
    display: block;
}
</style>